<?php
      
include(dirname(__FILE__).'/inc/config.php');
include(dirname(__FILE__).'/inc/listpage.class.php');
include(dirname(__FILE__).'/inc/tree.class.php');
include(dirname(__FILE__).'/inc/article.model.class.php');
include(dirname(__FILE__).'/inc/type.model.class.php');


//文章类
$TR  = new tree();
$DA  = new article();
$DT  = new type();


//  /article.php?id=19
//  /article.php?id=86
$id = isset($_GET['id'])? intval($_GET['id']):0;
if(!$id){ header('location:index.php');die(); }  





//当前文章 
$art =  $DA->init($id);
var_dump($art);

echo '<hr/>';

//浏览量+1
//$DA->click();

//上一页
//var_dump( $DA->prev() );

//下一页
//var_dump( $DA->next() );


//读取文章列表
//$list = $DA->getList(); // tid= 当前文章的tid   limit = 10    orderby  sorttime desc

//$list = $DA->getList(array('tid'=>5 ,  'limit' => 5 ,'orderby' => 'click desc'   )); 

//var_dump($list );



//当前文章 
$type =  $DT->init( $DA->data['tid'] );
//$type =  $DT->init( 999 );
//var_dump($DT);

//顶层栏目
//var_dump($DT->top());
//顶层栏目
//var_dump($DT->parent( 15 ));


//var_dump($DT->dl( 15 ));